﻿using System;

namespace Vortex.Drawing {

    ///<summary>Primitive drawing types</summary>
    public enum PrimitiveType {
        ///<summary>Undefined primitive type</summary>
		Undefined = 0,
        ///<summary>List of points</summary>
		PointList = 1,
        ///<summary>List of lines</summary>
		LineList = 2,
        ///<summary>Line strip</summary>
        ListStrip = 3,
        ///<summary>List of triangles</summary>
		TriangleList = 4,
        ///<summary>Triangle strip type</summary>
		TriangleStrip = 5,
        ///<summary>Triangle fan (first point in center)</summary>
		TriangleFan = 6
	};

    ///<summary>Enumeration of pixel formats for textures and surfaces supported by Vortex2D.NET</summary>
	public enum PixelFormat {
		///<summary>Generic pixel format with alpha channel</summary>
		DefaultAlpha		 = 21,
		///<summary>Generic pixel format without alpha channel</summary>
		Default				 = 22,
		///<summary>Undefined (automatically selected) pixel format</summary>
		Unknown = 0,
		///<summary>3-component 24 bit (8,8,8 bits per channel). Do not use it for textures</summary>
		R8G8B8				 = 20,
		///<summary>4-component 32-bit (8,8,8,8 bits per channel) pixel format with alpha channel</summary>
		A8R8G8B8			 = 21,
		///<summary>3-component 32-bit (8,8,8 bits per channel) pixel format without alpha channel</summary>
		X8R8G8B8			 = 22,
		///<summary>3-component 16-bit (5,6,5 bits per channel) pixel format without alpha channel</summary>
		R5G6B5				 = 23,
		///<summary>4-component 16-bit (1,5,5,5 bits per channel) pixel format with 1 bit alpha channel. (Can't be used for render target)</summary>
		A1R5G5B5			 = 25,
		///<summary>4-component 16-bit (4,4,4,4 bits per channel) pixel format with alpha channel. (Can't be used for render target)</summary>
		A4R4G4B4			 = 26,
		///<summary>1-component 32-bit single precision floating point pixel format with red channel only</summary>
		R32F				 = 114,
		///<summary>2-component 64-bit single precision floating point pixel format with green and red channels only</summary>
		G32R32F				 = 115,
		///<summary>4-component 128-bit single precision floating point pixel format with alpha channel. (Note, it consumes a lot of memory. 1Kx1K texture is 12M)</summary>
		A32B32G32R32F		 = 116
	};

	///<summary>Types of texture filtering techniques</summary>
	public enum TextureFilter {
        ///<summary>Nearest point filter. Worst quality but sharpness result. Only one point value is taken to calculate destination color.</summary>
		Point           = 1,
        ///<summary>Linear filter. Better quality because of interpolation f source pixels with weights. Weights calculation based from nearest pixels from source point.</summary>
		Linear          = 2
	};

	///<summary>Kind of testing rules which defines behavior of some process comparing two values</summary>
	public enum TestFunction {
        ///<summary>Disable testing</summary>
		None = 0,
        ///<summary>Test always fails</summary>
		Never = 1,
        ///<summary>Test is passed when first value is less than second one</summary>
		Less = 2,
        ///<summary>Test is passed only when both of values are equal</summary>
		Equal = 3,
        ///<summary>Test is passed when first value is less or equal second one</summary>
		LessOrEqual = 4,
        ///<summary>Test is passed when first value is greater than second one</summary>
		Greater = 5,
        ///<summary>Test is passed only when both of values are different</summary>
		NotEqual = 6,
        ///<summary>Test is passed when first value is greater or equal second one</summary>
		GreaterOrEqual = 7,
        ///<summary>Test is always success</summary>
		Always = 8
	};

	///<summary>Specifies argument selector for hardware color/alpha blending engine</summary>
	public enum BlendFactor
	{
        ///<summary>Argument is forced to zero</summary>
		Zero = 1,
        ///<summary>Argument is forced to one</summary>
		One = 2,
        ///<summary>Argument is source color value</summary>
		SrcColor = 3,
        ///<summary>Argument is inverted source color value</summary>
		InvSrcColor = 4,
        ///<summary>Argument is multiplied on source alpha value</summary>
		SrcAlpha = 5,
        ///<summary>Argument is multiplied on inverted source alpha value</summary>
		InvSrcAlpha = 6,
        ///<summary>Argument is multiplied on destination alpha value</summary>
		DestAlpha = 7,
        ///<summary>Argument is multiplied on inverted destination alpha value</summary>
		InvDestAlpha = 8,
        ///<summary>Argument is destination color value</summary>
		DestColor = 9,
        ///<summary>Argument is inverted destination color value</summary>		
        InvDestColor = 10,
        ///<summary>?</summary>
		SrcAlphaSat = 11
	};

	///<summary>Specifies which operation should be executed with source and destination operands of blender</summary>
	public enum BlendOperation 
	{
        ///<summary>Per-component addition</summary>
		Add = 1,
        ///<summary>Per-component subtraction</summary>
		Subtract = 2,
        ///<summary>Per-component subtraction with argument reversing</summary>
		RevSubtract = 3,
        ///<summary>Minimal value of each component is chosen</summary>
		Min = 4,
        ///<summary>Maximal value of each component is chosen</summary>
		Max = 5
	};

	///<summary>Defines behavior of texture addressation in UV space when value is out of 0..1 range</summary>
	public enum TextureAddressMode {
        ///<summary>Wrapping is applied to coordinates: 1.4 => 0.4, -0.4 => 0.4</summary>
		Wrap			= 1,
        ///<summary>Mirroring is applied to coordinates: 1.4 => 0.6, -0.4 => 0.4</summary>
		Mirror          = 2,
        ///<summary>Coordinates are limited in 0..1 range: 1.4 => 1, -0.4 => 0</summary>
		Clamp			= 3,
        ///<summary>If coordinate is out of 0..1 range than border color is taken</summary>
		Border			= 4,
        ///<summary>Applies mirroring but only once</summary>
		MirrorOnce		= 5
	};

	///<summary>Primitive rasterization rules</summary>
	public enum PrimitiveFillMode {
        ///<summary>Primitive vertices are rendered as point</summary>
		Point           = 1,
        ///<summary>Primitives consist from edges (lines)</summary>
		Wireframe		= 2,
        ///<summary>Primitives are shaded (default)</summary>
		Solid		    = 3
	};

	///<summary>List of supported vertex shader profiles</summary>
	public enum VertexShaderProfile {
        ///<summary>Oldest vertex shader profile (1.1)</summary>
		Vs_1_1			= 0x00010001,
        ///<summary>Vertex shader profile (2.0), preferred by Vortex2D.NET</summary>
		Vs_2_0			= 0x00020000,
        ///<summary>Advanced shader profile (3.0), supported by modern hardware</summary>
		Vs_3_0			= 0x00030000
	};

	//-------------------------------------------------------------------------
	///<summary>List of supported pixel shader profiles</summary>
	public enum PixelShaderProfile {
        ///<summary>Most primitive pixel shader profile (1.0)</summary>
		Ps_1_0			= 0x00010001,
        ///<summary>Old pixel shader profile (1.4)</summary>
		Ps_1_4			= 0x00010004,
        ///<summary>Pixel shader profile (2.0), preferred by Vortex2D.NET</summary>
		Ps_2_0			= 0x00020000,
        ///<summary>Pixel shader profile (3.0), supported by modern hardware</summary>
		Ps_3_0			= 0x00030000
	};

	//-------------------------------------------------------------------------
	///<summary>Defines kind of text layout </summary>
	[Flags]
	public enum TextLayout : ushort {
		///<summary>Default layout: Left, Top</summary>
		Default = 0,
		///<summary>Horizontal layout: Left</summary>
		Left = 0x0001,
		///<summary>Horizontal layout: Right</summary>
		Right = 0x0002,
		///<summary>Horizontal layout: Center</summary>
		Center = 0x0003,
		///<summary>Vertical layout: Top</summary>
		Top = 0x0100,
		///<summary>Vertical layout: Bottom</summary>
		Bottom = 0x0200,
		///<summary>Vertical layout: Middle</summary>
		Middle = 0x0300		
	};

	[Flags]
	///<summary>Additional flags for changing primitive drawing behaviour</summary>
	public enum DrawingFlags {
		///<summary>No additional flags. It means that all of given vertices are processed (texture UV coords). Only transform will be applied.</summary>
		None,
		///<summary>Enables transformation of UV1 coordinate pair into main texture coordinate space</summary>
		TransformUV1 = 1,
		///<summary>Enables transformation of UV2 coordinate pair into brush texture coordinate space</summary>
		TransformUV2 = 2,
		///<summary>Enables transformation of UV1 & UV2 coordinate pairs. It is combination of TransformUV1 | TransformUV1 flags </summary>
		TransformUV = TransformUV1 | TransformUV2,
		///<summary>Disables XY coordinate transform step</summary>
		SkipXYTransform = 4,
		///<summary>Forces to use canvas Z value for drawed vertices</summary>
		ForceCanvasZ = 8
	}


}